﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using System.Data.SqlClient;

namespace BenhVien
{
    public partial class fmListUser : Form
    {
        private Connection cons = new Connection();
        private DataTable dt = new DataTable();
        private SqlDataAdapter da = new SqlDataAdapter();
        public fmListUser()
        {
            InitializeComponent();
        }
        private void getData()
        {
            SqlCommand command = new SqlCommand();
            command.Connection = cons.con;
            command.CommandType = CommandType.Text;
            command.CommandText = @"Select DangNhap.Name,DangNhap.Pass,DangNhap.MaNV,NhanVien.Vitri from DangNhap,NhanVien Where NhanVien.MaNV=DangNhap.MaNV";
            da.SelectCommand = command;
            da.Fill(dt);
            dtGVListUser.DataSource = dt;

        }
        private void fmListUser_Load(object sender, EventArgs e)
        {
            cons.Connect();
            getData();
        }

        private void btOK_Click(object sender, EventArgs e)
        {
            this.Close();
            this.Dispose();
            //FormChinh _fmMain = new FormChinh();
            //_fmMain.Show();
        }

        
    }
}
